//
//  NoDataView.swift
//  AESOLAR_IOS
//
//  Created by Mr.Wang on 2019/9/3.
//  Copyright © 2019 Mr.Wang. All rights reserved.
//

import UIKit

class NoDataView: UIView {

    override init(frame: CGRect) {
        super.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_WIDTH * 0.8))
        self.isHidden = true
        
        let titleLabel = UILabel().config
            .textColor(#colorLiteral(red: 0.6, green: 0.6, blue: 0.6, alpha: 1))
            .font(.systemFont(ofSize: 14, weight: .medium))
            .text("暂无数据".localized)
            .addTo(self)
            .makeConstraints { (make) in
                make.bottom.equalTo(-10)
                make.centerX.equalToSuperview()
        }.view
        
        UIImageView().config
            .image(UIImage.init(named: "no_data_image"))
            .contentMode(.scaleAspectFit)
            .addTo(self)
            .makeConstraints { (make) in
                make.bottom.equalTo(titleLabel.snp.top).offset(-20)
                make.centerX.equalToSuperview()
                make.height.width.equalTo(110)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
